home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mikecom / msrflow.asm < prev    next >
Assembly Source File  |  1987-05-16  |  2KB  |  53 lines

  1.  
  2. title ENABLE/DISABLE MSR MONITORING
  3. include subfx.h
  4.  
  5. ;  Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503
  6.  
  7. IMPORT_NEAR     <__tx_inton>
  8.  
  9. ;****************************************************************************
  10. ; ASYNC_MSRFLOW  -- Enables or disables the monitoring of modem signals CTS,
  11. ;       DSR, or CD when transmitting.
  12. ;        Example: rcode = async_flow(COM1, B_CTS + B_CD);
  13. ;       The above would halt the transmitter if CTS goes low or if carrier
  14. ;       detect is lost -- keep in mind no commands will get sent to the modem
  15. ;       either (translated: don't monitor CD before connecting).  Returns
  16. ;       R_NOPORT if bad port arg is given, R_BADARG if invalid bits in Flag,
  17. ;       else returns R_OK.
  18. ;****************************************************************************
  19. begseg          COMM_TEXT
  20. publicproc      _async_msrflow
  21.         push    bp
  22.         mov     bp,sp
  23.         push    si              ;stack frame setup
  24.         call    __ck_port_arg   ;ck if valid, load pointers
  25.         jz      msrflw_exit     ;bad arg if ZR flag set
  26.         mov     ax,R_BADARG     ;setup in case of bad argument
  27.         mov     dx,1011000001001111b ;mask / NOT mask  for msr bits
  28.         test    MSRMntrFlg,dl
  29.         jnz     msrflw_exit     ;bad arg if any improper bits set in flag
  30.         mov     cx,dx
  31.         mov     al,MSRMntrFlg   ;get passed MSR flow mask
  32.         not     al              ;AL = NOT Flag
  33.         mov     MSR_MASK,al     ;update MSR_MASK variable
  34.         not     al              ;AL = Flag
  35.         cli
  36.         and     cl,TX_STAT      ;CL= TX_STAT with all mdm flw bits clr'd
  37.         and     ch,MSR_VAL
  38.         and     ch,al           ;CH= bits in MSR val to be used in flow chk'g
  39.         xor     al,ch           ;AL= not function of bits to be tested
  40.         or      al,cl           ;AL= new TX_STAT
  41.         mov     TX_STAT,al      ;store it
  42.         jnz     msrflw_exit     ;TX_STAT == NZ = don't start up txmtr
  43.         call    __tx_inton      ;TX_STAT == ZR = start up txmtr
  44. msrflw_exit:
  45.         sti
  46.         pop     si
  47.         pop     bp
  48.         ret                     ;restore regs and exit
  49. _async_msrflow  endp
  50.  
  51. endseg          COMM_TEXT
  52.         end
  53.